using System;

namespace Dbam.DbFramework
{
	/// <summary>
	/// Attribute for specifying the table in the database the entity maps to.
	/// </summary>
	[AttributeUsage(AttributeTargets.Class, AllowMultiple=false, Inherited=true)]
	public class TableAttribute
		: Attribute
	{
		#region Data Members

		/// <summary>
		/// The table the entity maps to.
		/// </summary>
		private string _tableName;

		#endregion

		#region Cosntructor(s)

		/// <summary>
		/// Initialize the attribute with the name of the table the entity maps to.
		/// </summary>
		/// <param name="tableName">The table name.</param>
		public TableAttribute(string tableName)
		{
			_tableName = tableName;
		}

		#endregion

		#region Properties

		/// <summary>
		/// Gets the table name the entity maps to.
		/// </summary>
		public string TableName
		{
			get { return _tableName; }
		}

		#endregion
	}
}